package com.xq.springboot.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.Email;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/16 12:16
 * @description 学生实体类
 * ConfigurationProperties注解：配置此注解的prefix属性在application.yml/properties中会有student的属性提示，
 * 前提先启动SpringBoot启动类后，才能在配置文件中有提示
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@ConfigurationProperties(prefix = "student")
@PropertySource(value = "classpath:application.yml")
public class Student {
    private Integer id;
    private String name;
    private String[] hobby;
    private List<String> list;
    private Map<String, Object> map;
    private Set<Object> set;
    private Integer age;
    private Date birth;
}
